<?php
namespace App\Transformers;
use App\Models\User;
use League\Fractal\TransformerAbstract;

class UserTransformer extends TransformerAbstract
{
    public function transform(User $user){
        return [
            'id'         =>$user->id,
            'email'      =>$user->email,
            'name'     =>$user->name,
            'avatar'  =>$user->avatar,
//            'avatar_url'=>oss($user->avater),
            'created_at' =>$user->created_at,
//            'updated_at' =>$user->updated_at
            'home' =>$user->home,
            'sex' =>$user->sex,
            'birthday' =>$user->birthday,
            'sel_show' =>$user->sel_show,
        ];
    }
}
